<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        ul{list-style: none;}
        ul li{
            width:50px;height:50px;line-height:50px;border: 1px solid #333;text-align: center;cursor: pointer;
        }
    </style>
</head>
<body>
<ul>
    <li class="aa" id="aa">1</li>
    <li class="aa">2</li>
    <li class="aa">3</li>
</ul>
<script>
    var aa=document.querySelector("#aa");
    aa.onclick=function(){
        aa.className="blue";  /*重新定义元素的类名*/
    }
</script>
</body>
</html>